package com.immac.chan.util;

import java.util.Date;

@SuppressWarnings("deprecation")
public class LeeJCTypeChanger {
	public static Date ChangeStringToDate(String str) throws Exception {
		Date date = null;
		
		int[] iDates = new int[3];
		int index = 0;
		
		for (int i = 0; i < iDates.length; i++) {
			String temp = new String("");
			char ch = 0;
			
			while (index < str.length() && (ch = str.charAt(index++)) != '-') {
				temp += ch;
			}

			iDates[i] = Integer.parseInt(temp);
		}
		
		date = new Date(iDates[0] - 1900, iDates[1] - 1, iDates[2]);
		
		return date;
	}
}
